/* 增强版用户管理系统样式 */
/* 文件路径: frontend/static/css/user_management_enhanced.css */

/* 全局样式 */
.user-management-container {
  background-color: #f8f9fa;
  min-height: calc(100vh - 120px);
}

/* 加载覆盖层 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-spinner {
  width: 3rem;
  height: 3rem;
  border: 0.25rem solid #e9ecef;
  border-top: 0.25rem solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 筛选区域 */
.filters-section {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 1.5rem;
}

.filter-title {
  color: #495057;
  font-weight: 600;
  margin-bottom: 1rem;
  border-bottom: 2px solid #007bff;
  padding-bottom: 0.5rem;
}

.quick-search-input {
  border-radius: 25px;
  padding-left: 2.5rem;
  border: 2px solid #e9ecef;
  transition: all 0.3s ease;
}

.quick-search-input:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #6c757d;
}

/* 操作按钮区域 */
.actions-section {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 1.5rem;
}

.stats-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}

.stats-number {
  font-size: 2rem;
  font-weight: bold;
  display: block;
}

.stats-label {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* 用户卡片 */
.user-card {
  transition: all 0.3s ease;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  overflow: hidden;
  height: 100%;
}

.user-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.user-card.selected {
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.user-card .card-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  padding: 0.75rem 1rem;
}

.user-card .card-body {
  padding: 1rem;
}

.user-card .card-title {
  color: #495057;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.user-card .text-muted {
  font-size: 0.875rem;
  line-height: 1.4;
}

.user-card .card-footer {
  background-color: #f8f9fa;
  border-top: 1px solid #e9ecef;
  padding: 0.75rem 1rem;
}

/* 状态徽章 */
.badge {
  font-size: 0.75rem;
  padding: 0.375rem 0.75rem;
}

/* 分页 */
.pagination-section {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  padding: 1rem;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.page-info {
  color: #6c757d;
  font-size: 0.9rem;
}

/* 模态框样式 */
.modal {
  background-color: rgba(0, 0, 0, 0.5);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1050;
  overflow-y: auto;
}

.modal.show {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.modal-dialog {
  margin: 1rem;
  max-width: 700px;
  width: 100%;
}

.modal-content {
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
  border-bottom: 1px solid #e9ecef;
  background-color: #f8f9fa;
}

.modal-footer {
  border-top: 1px solid #e9ecef;
  background-color: #f8f9fa;
}

/* 表单样式 */
.form-label {
  font-weight: 600;
  color: #495057;
}

.form-control, .form-select {
  border-radius: 6px;
  border: 1px solid #ced4da;
  transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-check-input:checked {
  background-color: #007bff;
  border-color: #007bff;
}

/* 按钮样式 */
.btn {
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-outline-primary:hover,
.btn-outline-info:hover,
.btn-outline-danger:hover {
  transform: translateY(-1px);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .user-card {
    margin-bottom: 1rem;
  }
  
  .filters-section .row {
    margin-left: 0;
    margin-right: 0;
  }
  
  .filters-section .col-md-3,
  .filters-section .col-md-4 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    margin-bottom: 1rem;
  }
  
  .actions-section .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  .pagination-controls {
    flex-direction: column;
    gap: 0.5rem;
  }
}

@media (max-width: 576px) {
  .user-management-container {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  
  .modal-dialog {
    margin: 0.5rem;
  }
  
  .card-footer .btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
  }
}

/* 自定义滚动条 */
.user-cards-container::-webkit-scrollbar {
  width: 6px;
}

.user-cards-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.user-cards-container::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.user-cards-container::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 动画效果 */
.fade-in {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 角色复选框组样式 */
#roleCheckboxGroup,
#batchRoleCheckboxGroup {
  max-height: 200px;
  overflow-y: auto;
}

#roleCheckboxGroup .form-check,
#batchRoleCheckboxGroup .form-check {
  margin-bottom: 0.5rem;
}

/* 空状态样式 */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #6c757d;
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* 错误状态样式 */
.error-state {
  text-align: center;
  padding: 2rem 1rem;
  color: #dc3545;
}

/* 工具提示样式 */
.tooltip {
  font-size: 0.875rem;
}

/* 表单验证样式 */
.is-invalid {
  border-color: #dc3545;
}

.invalid-feedback {
  display: block;
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* 成功状态样式 */
.is-valid {
  border-color: #28a745;
}

.valid-feedback {
  display: block;
  color: #28a745;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}
